﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Guest.Master" AutoEventWireup="True"
    CodeBehind="Write.aspx.cs" Inherits="ScrumLite.WebUx.ReviewsViews.Write" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
    function save()
    {
        var occurredOn = document.getElementById("occurredOn");
        var conductedBy = document.getElementById("conductedBy");
        var evidencePath = document.getElementById("evidencePath");
        
        if (occurredOn.value == "")
        {
            alert("must insert a occurredOn date");
            return;
        }
        
        if (conductedBy.value == "")
        {
            alert("must insert a conductedBy name");
            return;
        }
        
        if (evidencePath.value == "")
        {
            alert("must insert an evidence url");
            return;
        }

        document.forms[0].submit();
    }
    </script>
<h1>
    <%=ViewData.ProjectName%></h1>
<hr />
<h2>Reviews</h2>
    
    <form action="<%=Url.Action( new { Controller="Reviews", Action="Save" })%>"
    method="post">
     
    <div class="actions">
        <a href="javascript:void(0);" tabindex="6" onclick="javascript:save();">Save</a>&nbsp;&nbsp;&nbsp;
        <%=Html.ActionLink("Cancel", new { Controller = "Reviews", Action = "List" })%>
    </div>
    <br />
        
<br />

    <input name="id" id="id" type="hidden" value="<%=ViewData.Review.Id != Guid.Empty ? ViewData.Review.Id.ToString() : "" %>" />
    <div>
        <p><strong>
            Occured On</strong><br />
            <input name="occurredOn" id="occurredOn" tabindex="1" value="<%=ViewData.Review.OccurredOn.ToString("yyyy-MM-dd")%>" size="10" />
        </p>
        <p>
            <strong>Conducted By</strong><br />
            <input name="conductedBy" id="conductedBy" tabindex="2" value="<%=ViewData.Review.ConductedBy%>" />
        </p>
        <p>
            <strong>Evidence Url</strong><br />
            <input name="evidencePath" id="evidencePath" tabindex="3" value="<%=ViewData.Review.EvidenceUrl%>" size="80" />
        </p>      
    </div>
    <br />
        <div class="actions">
            <a href="javascript:void(0);" tabindex="6" onclick="javascript:save();">Save</a>&nbsp;&nbsp;&nbsp;
            <%=Html.ActionLink("Cancel", new { Controller = "Reviews", Action = "List" })%>
        </div>
    </form>
</asp:Content>
